<?php
// +----------------------------------------------------------------------
// | makePHP 
// +----------------------------------------------------------------------
// | Copyright (c) 2009 http://makephp.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed BSD.(http://www.make.org/BSD-license.txt)
// +----------------------------------------------------------------------
// | Author: 叁石(sanshi) <sanshi0815@tom.com>
// | Author: 白家昌<baijc2004cn@126.com>
// +----------------------------------------------------------------------

class index extends TheAdmin
{
	public function index()
	{
	}
	public function set()
	{
		$this->TheAdmin();
		//取得用户对于该类的权限
		$user_p = $this->get_user_popedom_by_class_name(__CLASS__);
		$class_p_arr = $this->show_p();
		//取得该类的权值数组
		$class_method = $class_p_arr['class_method'];
		//取得用户操作菜单
		
		$menu = array();
		/*
		foreach ($class_method as $k=>$v)
		{
			if( ($user_p & $v[2]) && (isset($v[3]) ?$v[3] :false))
			{
				array_push($menu,array('url'=>"?c=".__CLASS__."&m={$v[0]}",'title'=>$v[1]));
			}
		}
		*/
		$this->smarty->assign("is_not_show_menu",true);
		//用户有权菜单生成 可以添加其他操作
		$this->smarty->assign('menus',$menu);
		$this->smarty->assign("main_menus",$this->get_user_menus());
		//print_r($menu);
	}
	
	function show()
	{
		$this->smarty->display("admin_index.tpl");
	}
	public function show_p()
	{
		//该方法为，提供用户使用方法定义，非web用户权限相关不用写
		return array(
			/* 定义该类中文名称*/
			'class_name'=>array(__CLASS__,'用户首页'),
			'class_method' =>array(
				//array（方法名，中文解释，权值,是否为菜单）
				'show'  => array('show','欢迎',1,true),
				'show_p'=> array('show_p','',0,false)
			)
		);
	}
}
?>